From f8e1ed821d9c7827cfe2c6dd06aeb5ff0495c57b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 3 Jul 2004 05:29:03 +0000 Subject: [PATCH] Correct the math to calculate bilinear weights. (#112412, Brian Cameron) Sat Jul 3 00:41:44 2004 Matthias Clasen * pixops/pixops.c (bilinear_box_make_weights): Correct the math to calculate bilinear weights. (#112412, Brian Cameron) --- gdk-pixbuf/ChangeLog | 5 +++++ gdk-pixbuf/pixops/pixops.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 64a6f7764f..8716efd959 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,8 @@ +Sat Jul 3 00:41:44 2004 Matthias Clasen + + * pixops/pixops.c (bilinear_box_make_weights): Correct the + math to calculate bilinear weights. (#112412, Brian Cameron) + Mon Jun 21 00:44:51 2004 Matthias Clasen * gdk-pixbuf-transform.h: diff --git a/gdk-pixbuf/pixops/pixops.c b/gdk-pixbuf/pixops/pixops.c index e4a086c2f0..6f629d90ba 100644 --- a/gdk-pixbuf/pixops/pixops.c +++ b/gdk-pixbuf/pixops/pixops.c @@ -1312,7 +1312,7 @@ bilinear_box_make_weights (PixopsFilterDimension *dim, dim->n = n; dim->weights = pixel_weights; - for (offset =0 ; offset < SUBSAMPLE; offset++) + for (offset = 0; offset < SUBSAMPLE; offset++) { double x = (double)offset / SUBSAMPLE; double a = x + 1 / scale; @@ -1320,7 +1320,7 @@ bilinear_box_make_weights (PixopsFilterDimension *dim, for (i = 0; i < n; i++) { w = linear_box_half (0.5 + i - a, 0.5 + i - x); - w += linear_box_half (1.5 + x - i, 1.5 + a - i); + w += linear_box_half (0.5 + x - i, 0.5 + a - i); *(pixel_weights++) = w * scale; } -- 2.30.2